/* tslint:disable */
import {
  <%- model.from[0].toUpperCase() + model.from.slice(1) %>,
  <%- model.to[0].toUpperCase() + model.to.slice(1) %>
} from '../index';

declare var Object: any;
export interface <%- modelName %>Interface {
  "id"?: any;
  "<%- model.from[0].toLowerCase() + model.from.slice(1) %>Id": any;
  "<%- model.to[0].toLowerCase() + model.to.slice(1) %>Id": any;
}

export class <%- modelName %> implements <%- modelName %>Interface {
  "id"?: any;
  "<%- model.from[0].toLowerCase() + model.from.slice(1) %>Id": any;
  "<%- model.to[0].toLowerCase() + model.to.slice(1) %>Id": any;
  constructor(data?: <%- modelName %>Interface) {
    Object.assign(this, data);
  }
  /**
   * The name of the model represented by this $resource,
   * i.e. `<%- modelName %>`.
   */
  public static getModelName() {
    return "<%- modelName %>";
  }
  /**
  * @method factory
  * @author João Ribeiro
  * @license MIT
  * This method creates an instance of <%- modelName %> for dynamic purposes.
  **/
  public static factory(data: <%- modelName %>Interface): <%- modelName %>{
    return new <%- modelName %>(data);
  }
  /**
  * @method getModelDefinition
  * @author João Ribeiro
  * @license MIT
  * This method returns an object that represents some of the model
  * definitions.
  **/
  public static getModelDefinition() {
    return {
      name: '<%- modelName %>',
      idName: 'id',
      properties: {
        "id": {
          name: 'id',
          type: 'any'
        },
        "<%- model.from[0].toLowerCase() + model.from.slice(1) %>Id": {
          name: '<%- model.from[0].toLowerCase() + model.from.slice(1) %>Id',
          type: 'any'
        },
        "<%- model.to[0].toLowerCase() + model.to.slice(1) %>Id": {
          name: '<%- model.to[0].toLowerCase() + model.to.slice(1) %>Id',
          type: 'any'
        }
      }
    }
  }
}
